﻿using MediatR;
using SystemWFH.API.Application.Command.WorkshopCommand;
using SystemWFH.Domain;
using SystemWFH.Infrstructer.Interface;

namespace SystemWFH.API.Application.CommandHandlers.WorkshopCommandHandler
{
    public class WorkshopFindCommandHandler : IRequestHandler<WorkshopFindCommand, Workshop>
    {
        private readonly IWorkshopRepository workshopRepository;
        public WorkshopFindCommandHandler(IWorkshopRepository workshopRepository)
        {
            this.workshopRepository = workshopRepository;
        }
        public async Task<Workshop> Handle(WorkshopFindCommand request, CancellationToken cancellationToken)
        {
            var list = await workshopRepository.GetValue(request.workshopId);
            return list;
        }
    }
}
